﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;

namespace He.Web.manage.order
{
    public partial class list : He.Web.UI.Manage
    {
        protected int pageSize = 12;
        protected int page;
        protected int pcount;
        public string pos_mark;
        protected void Page_Load(object sender, EventArgs e)
        {
            pos_mark = GetString("pos_mark");
            page = GetInt("page", 0);
            if (!IsPostBack)
            {
                chkLoginLevel("view" + pos_mark);
                RptBind();
            }
        }

        #region 赋值操作
        private void RptBind()
        {
            He.BLL.order bll = new He.BLL.order();
            string strWhere = CombPlugSqlTxt(pos_mark, lang);
            rptInfo.DataSource = bll.GetPageList(pageSize, page, strWhere, "Id desc");
            rptInfo.DataBind();
            pcount = bll.GetRecordCount(strWhere);
        }
        #endregion


        protected void lbtnDel_Click(object sender, EventArgs e)
        {
            chkLoginLevel("del" + pos_mark);
            BLL.order bll = new BLL.order();
            for (int i = 0; i < rptInfo.Items.Count; i++)
            {
                CheckBox cb = (CheckBox)rptInfo.Items[i].FindControl("Check");
                int id = int.Parse(((HiddenField)rptInfo.Items[i].FindControl("HiddenId")).Value);
                if (cb.Checked)
                {
                    bll.Delete(id);
                }
            }
            SaveLogs("[在线订单管理]批量删除");
            JscriptPrint("批量删除成功啦！", Request.RawUrl, "Success");
        }
    }
}
